import {reqgetCategoryList} from "@/api";
//仓库
const state = {
    //home仓库中存储三级菜单的数据
    categoryList: [],
}
// mutions是唯一修改state的地方
const mutations = {
    setCategoryList(state, categoryList) {
        state.categoryList = categoryList;
    }
}
// 用户处理派发action地方的，可以书写异步语句、自己逻辑地方
const actions = {
   async getCategoryList({commit}) {
        let result = await reqgetCategoryList();
        if (result.code == 200) {
            commit("setCategoryList", result.data);
        }
    }

}

//计算属性
const getters = {};

export default {
    state,
    mutations,
    actions,
    getters
}
